<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <div th:include="base-libs :: base-libs" />
    <title>慢病管理台账—修改</title>

    <style>
        .laydate_box{
            top:0 !important;
        }
        .laydate-icon{
            border:1px solid #B6B6B6;
            height:28px;
            width:88% !important;
        }
    </style>
    <script>
        $(function(){
            initView();
            $(this).registerManagerPage({callback:initData});
        })

        function initView(){
            $("input").css("paddingLeft","3px");
            enterToQuery(function(){
                $("#btnTj").trigger("click");
            });

            /** 确定修改 */
            $("#btnTj").click(function(){
                if($(".form-control").QuickValidate()){
                    $.QuickRemote.AjaxFiledFormSubmit("formTj", function(result){
                        if(result.state){
                            $.QuickAlert.alertNormal(result.info, {callback: function(){
                                StoreCache.setCache("refresh",true);
                                $("#btnQx").trigger("click");
                            }});
                        }else{
                            $.QuickAlert.alertFail({content: result.info});
                        }
                    }, {type:'update'});
                }
            })

            /** 取消修改 */
            $("#btnQx").click(function(){
                parent.layer.closeAll();
            })
        }

        function initData(){
            var mbgltzData = StoreCache.removeCache("mbgltzData");
            if(!$.isEmptyObject(mbgltzData)){
                var timeReg = /^(\d{4}-\d{2}-\d{2})\s+\d{2}:\d{2}:\d{2}/;
                $(".form-control").each(function(){
                    var key = $(this).attr("name");
                    $(this).val(mbgltzData[key].replace(timeReg, "$1"));
                })
            }else{
                $.QuickAlert.alertFail({content: "数据丢失，请重新进入!"});
            }
        }
    </script>
</head>
<body class="easyui-layout">
    <div region="center">
        <form action="save" id="formTj">
            <table class="form-table" id="conditionBox" style="margin-top:20px;">
                <tr>
                    <td class="td-text"><label>随访时间：</label></td>
                    <td class="td-content">
                        <input name="ID" class="form-control" readonly hidden type="hidden"/>
                        <input name="SFSJ" class="form-control laydate-icon" readonly
                        quick-config="label:'随访时间', validateProxy:'notNull'" onclick="laydate()"/>
                    </td>
                    <td class="td-text"><label>患者姓名：</label></td>
                    <td class="td-content">
                        <input name="HZXM" class="form-control"  style="width: 100%;"
                        quick-config="label:'患者姓名', validateProxy:'notNull length', length: '32'" />
                    </td>
                    <td class="td-text"><label>证件号码：</label></td>
                    <td class="td-content">
                        <input name="SFZH" class="form-control"  style="width: 100%;"
                               quick-config="label:'证件号码', validateProxy:'notNull idCard length', length: '32'"/>
                    </td>
                </tr>
                <tr>
                    <td class="td-text"><label>慢病类型：</label></td>
                    <td class="td-content">
                        <select name="MBLX" class="form-control condition" style="width: 100%;" cacheTable="TB_ZY_MBLX"
                                quick-config="label:'慢病类型', validateProxy:'notNull'">
                        </select>
                    </td>
                    <td class="td-text"><label>危险分层：</label></td>
                    <td class="td-content">
                        <select name="WXFC" class="form-control condition" style="width: 100%;" cacheTable="TB_ZY_WXFC"
                                quick-config="label:'危险分层', validateProxy:'notNull'">
                        </select>
                    </td>
                    <td class="td-text"><label>关键指标：</label></td>
                    <td class="td-content">
                        <input name="GJZB" class="form-control" style="width: 100%;"
                               quick-config="label:'关键指标', validateProxy:'notNull length', length: '128'"/>
                    </td>
                </tr>
                <tr>
                    <td class="td-text"><label>随访结果：</label></td>
                    <td class="td-content">
                        <select name="SFJG" class="form-control condition" style="width: 100%;" cacheTable="TB_ZY_SFJG"
                                quick-config="label:'随访结果', validateProxy:'notNull'">
                        </select>
                    </td>
                    <td class="td-text"><label>随访方式：</label></td>
                    <td class="td-content">
                        <select name="SFFS" class="form-control condition" style="width: 100%;" cacheTable="TB_ZY_SFFS"
                                quick-config="label:'随访方式', validateProxy:'notNull'">
                        </select>
                    </td>
                    <td class="td-text"><label>随访医生：</label></td>
                    <td class="td-content">
                        <input name="SFYS" class="form-control"  style="width: 100%;"
                               quick-config="label:'随访医生', validateProxy:'notNull length', length: '32'"/>
                    </td>
                </tr>
            </table>
        </form>
    </div>
    <div region="south" style="height:40px;line-height:40px;border:0;border-top:1px solid #ddd;text-align: center;overflow: hidden">
        <button id="btnTj" class="btn btn-info" type="button">提交</button>
        <button id="btnQx" class="btn btn-info" type="button">取消</button>
    </div>
</body>
</html>